package com.beamfield.dao.sys;

import com.beamfield.model.Message;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MessageMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Message record);

    int insertSelective(Message record);

    int insertList(List<Message> messageList);

    Message selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Message record);

    int updateByPrimaryKey(Message record);

    List<Message> selectPage(@Param("offset") String offset,
                             @Param("limit") String limit,
                             @Param("beamId") Long beamId,
                             @Param("userId") Long userId,
                             @Param("titlecontent") String titlecontent,
                             @Param("mbExceptList") List<Integer> mbExceptList);

    Long countPage(@Param("beamId") Long beamId,
                   @Param("userId") Long userId,
                   @Param("titlecontent") String titlecontent,
                   @Param("mbExceptList") List<Integer> mbExceptList);

    Long countByState(@Param("beamId") Long beamId, @Param("userId") Long userId, @Param("state") int state,@Param("mbExceptList") List<Integer> mbExceptList);

    List<Message> countUpcoming(@Param("beamId") Long beamId, @Param("userId") Long userId, @Param("state") int state,@Param("mbExceptList") List<Integer> mbExceptList);

    List<Message> selectPageByType(@Param("offset") String offset,
                                   @Param("limit") String limit,
                                   @Param("userId") Long userId,
                                   @Param("beamId") Long beamId,
                                   @Param("state") Integer state,
                                   @Param("typeList") List<Integer> typeList);

    Long countPageByType(@Param("userId") Long userId,
                         @Param("beamId") Long beamId,
                         @Param("state") Integer state,
                         @Param("typeList") List<Integer> typeList);

    List<Message> selectByCodeAndType(@Param("code") String code, @Param("type") Integer type, @Param("beamId") Long beamId);
}